<template>
  <div id="app">
    <div>根组件</div>
    <router-link to="/home" tag="li" active-class="hehe"> 首页 </router-link>
    <router-link to="/shopcar" tag="li" active-class="hehe">
      购物车
    </router-link>
    <router-link to="/my" tag="li" active-class="hehe"> 我的 </router-link>
    <button @click="jump">组件内传参</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  methods: {
    jump() {
      this.$router.push({ name: "my", params: { us: 123 } });
    },
  },
};
</script>

<style>
.hehe {
  background: red;
}
</style>
